<?
/*
----------------------------------------------------------------------
file: hc_template.php
time: 2008.09
author: joecen
site: http://www.joecen.com/hcacti/
----------------------------------------------------------------------
*/
if(!isset($_REQUEST['host']) || !isset($_REQUEST['verify'])) die("Not enough argument!");

include(dirname(__FILE__) . "/../include/global.php");
include_once($config["base_path"] . "/include/config.php");
include_once($config["base_path"] . "/lib/database.php");
include_once($config["base_path"] . "/hcacti/hc_config.php");
include_once($config["base_path"] . "/hcacti/hc_function.php");

if($_REQUEST['verify'] != $hcacti_verify) die("Verify fail!");

db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port);

$template_names = db_fetch_assoc("
	select c.name from host as a , 
	data_local as b , data_template as c 
	where a.hostname='".$_REQUEST['host']."' 
	and a.id=b.host_id 
	and b.data_template_id=c.id");

foreach($template_names as $temp){
	print $temp['name']."\n";
}
db_close();

?>
